//index.js
var app = getApp()
import {
    throttle
} from '../../utils/common.js';
Page({
    data: {
        navHeight: app.globalData.navHeight, //导航栏高度
    },
    onLoad: function (opt) {},
    //微信授权登录
    // throttle
    getUserProfile: throttle(function () {
        console.log('微信授权登录-=-=-=-=--');
        wx.setStorageSync('avatarUrl', 'https://thirdwx.qlogo.cn/mmopen/vi_32/POgEwh4mIHO4nibH0KlMECNjjGxQUq24ZEaGT4poC6icRiccVGKSyXwibcPq4BWmiaIGuG1icwxaQX6grC9VemZoJ8rg/132');
        wx.setStorageSync('nickName', '微信用户');
        app.login(function () {
            wx.navigateBack({
                fail() {
                    wx.switchTab({
                        url: '/pages/index/index',
                    })
                },
            });
        });

    }, 1000),
    // getUserProfile(e) {
    //   wx.setStorageSync('avatarUrl', 'https://thirdwx.qlogo.cn/mmopen/vi_32/POgEwh4mIHO4nibH0KlMECNjjGxQUq24ZEaGT4poC6icRiccVGKSyXwibcPq4BWmiaIGuG1icwxaQX6grC9VemZoJ8rg/132');
    //   wx.setStorageSync('nickName', '微信用户');
    //   app.login(function (userInfo) {});
    //   wx.navigateBack({
    //     fail() {
    //       wx.switchTab({
    //         url: '/pages/index/index',
    //       })
    //     },
    //   });
    // },
    //拒绝
    goBack: function (e) {
        app.gotaburl('index/index');
    },

})